package com.xoa.controller.performance;

import com.xoa.model.performance.ScoreItem;
import com.xoa.service.performance.ScoreItemService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/ScoreItemController")
/**
 * 指标集明细
 */
public class ScoreItemController {
    @Autowired
    private ScoreItemService scoreItemService;


    @RequestMapping("/assessmentmingxi")
    public String assessmentmingxi() {
        return "app/hr/assessmentmingxi";
    }
    @RequestMapping("/assessmentziping")
    public String assessmentziping() {
        return "app/hr/assessmentziping";
    }
    /**
     * 郭心雨
     * 2018.06.22
     * 添加考核指标明细
     * @param scoreItem
     * @return
     */
    @RequestMapping("/addScoreItem")
    @ResponseBody
    public ToJson addScoreItem(ScoreItem scoreItem){
        return scoreItemService.addScoreItem(scoreItem);
    }

    /**
     * 郭心雨
     * 2018.06.22
     * 删除考核指标明细
     * @param itemId
     * @return
     */
    @RequestMapping("/delScoreItem")
    @ResponseBody
    public ToJson delScoreItem(Integer itemId){
        return scoreItemService.delScoreItem(itemId);
    }

    /**
     * 郭心雨
     * 2018.06.22
     * 修改考核指标明细
     * @param scoreItem
     * @return
     */
    @RequestMapping("/modifyScoreItem")
    @ResponseBody
    public ToJson modifyScoreItem(ScoreItem scoreItem){
        return scoreItemService.modifyScoreItem(scoreItem);
    }

    /**
     * 郭心雨
     * 2018.06.22
     * 动态查看考核指标明细
     * @param scoreItem
     * @param page
     * @param pageSize
     * @param useFlag
     * @return
     */
    @RequestMapping("/selScoreItem")
    @ResponseBody
    public ToJson selScoreItem(ScoreItem scoreItem,@RequestParam(value = "page",required = false) Integer page,
                               @RequestParam(value = "pageSize",required = false) Integer pageSize,
                               @RequestParam(value="useFlag",required = false) Boolean useFlag){
        return scoreItemService.selScoreItem(scoreItem,page,pageSize,useFlag);
    }




}
